<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/4/19 0019
  Time: 下午 4:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>会议首页</title>
</head>
<body>

姓名: <input type="text" name="name" id="name">
性别:
<select name="typee"  id="select">
    <option name="" value="">请选择类型</option>
    <option name="typee" value="1">公告</option>
    <option name="typee" value="0">会议</option>
</select>

<button type="button" id="search">查询</button>

</div>

        <table>
            <tr>
                <th>会议标题</th>
                <th>会议类型</th>
                <th>添加日期</th>
                <th>操作</th>
            </tr>
        </table>
        <c:forEach items="${pageable.rows}" var="items" varStatus="index">
            <tr>
                <td>${items.name}</td>
                <c:choose>
                    <c:when test="${items.typee eq 1}">会议</c:when>
                    <c:when test="${items.typee eq 0}">公告</c:when>
                    <c:otherwise>
                        未知
                    </c:otherwise>
                </c:choose>
                <td>${items.riqi}</td>
                <td>
                        <%-- 根据deparmentId查询 绑定  --%>
                    <a href="/meet/m/update?meetId=${items.id}"><button>编辑</button></a>
                    <a href="/meet/delete?meetId=${items.id}"><button>删除</button></a>
                </td>
            </tr>
        </c:forEach>

        <div>
            共<span>${pageable.pageCount}</span>页
            <button id="shang">上一页</button>
            <button id="xia">下一页</button>
            第 <span id="page">${pageable.current}</span>页

            <a href="/index.jsp">返回</a>

        </div>
        <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
        <script>
            $(function(){
                $("#shang").on('click',function (){
                    var page = Number($("#page").html());
                    if (page >1){
                        location.href = "/meet/list?page="+(page-1)+"&size=5";
                    }
                });

                $("#xia").on('click',function () {
                    var page = Number($("#page").html());
                    location.href="/meet/list?page="+(page+1)+"&size=5";
                });

                $("#search").on('click',function () {
                    var name = $("#name").val();
                    var sex = $("#select").val();
                    location.href="/meet/list?name="+name+"&sex="+sex;
                });
            });
        </script>
</body>
</html>
